Encrypting Passwords in Tomcat (PASService.xml)

It’s a good practice to encrypt the database passwords in PASService.xml. This is taken care of during the run time of the container.

Remove the value of “DSPASSWORD” from sl_env.dat once the container is up and running.

The Dockerfiles directory structure is as follows:

SL Dockerfiles

Under scripts folder (servicelayer/scripts)

Note: Place the OIPA build artifact which is downloaded from the Oracle Software Delivery Cloud in the externallibs/zip directory. Check the below snippet for your reference.

Under externallibs folder

From the Dockerfile location, execute the below command (a sample build.sh file is placed for reference):

docker build format:

$ docker build --network=host -t <Image_Name>:<Image_Tag> . --build-arg SL_PKG="<SL Package Name>"

docker build example:

$ docker build --network=host -t sl_tomcat:26.1.0.0 . --build-arg SL_PKG="PASService-tomcat-distribution.zip"

To start the containerized Service Layer application, run

docker run format (-v refers to volumes)

$ docker run -itd --network=host --privileged -v /path/to/the/externallibs:/usr/local/tomcat/externallibs --env-file /path/to/the/sl_env.dat -p <App_External_Port>:<App_Container_Port> --name <Container_Name> --hostname localhost <Image_Name>:<Image_Tag> createServer.sh $DB_TYPE

docker run example:

For ORACLE :

$ docker run -d --restart unless-stopped --network=host --privileged -v /path/to/externallibs:/usr/local/tomcat/externallibs/ --env-file /home/servicelayer/sl_env.dat -p 5050:5050 --name sl_tomcat --hostname localhost sl_tomcat:26.1.0.0 createServer.sh ORACLE

For DB2 :

$ docker run -d --restart unless-stopped --network=host --privileged -v /path/to/externallibs:/usr/local/tomcat/externallibs/ --env-file /home/servicelayer/sl_env.dat -p 5050:5050 --name sl_tomcat --hostname localhost sl_tomcat:26.1.0.0 createServer.sh DB2

For MSSQL:

$ docker run -d --restart unless-stopped --network=host --privileged -v /path/to/externallibs:/usr/local/tomcat/externallibs/ --env-file /home/servicelayer/sl_env.dat -p 5050:5050 --name sl_tomcat --hostname localhost sl_tomcat:26.1.0.0 createServer.sh MSSQL

Make sure you define the Database names as below only (Case Sensitive)

  • Oracle Database: ORACLE

  • DB2 Database: DB2

  • SQL Database: MSSQL

Check the docker logs in the PUTTY console by executing the below command:

$ docker logs -f sl_tomcat

Access the application when you see the Server startup in [xxxxxx] milliseconds message in the PUTTY console.